Skip to content

Comments

Add support of federated multisearch#571

Merged
meili-bors[bot] merged 15 commits intomeilisearch:mainfrom
apt-TebbeM:federated-multisearch
Aug 8, 2025
Merged

Add support of federated multisearch#571
meili-bors[bot] merged 15 commits intomeilisearch:mainfrom
apt-TebbeM:federated-multisearch

Conversation

@apt-TebbeM
Copy link
Contributor

Pull Request

Related issue

Fixes #560

What does this PR do?

  • increases meilisearch version to 1.10.0 in docker-compose.yaml
  • adds new method on MeilisearchClient for federated search
  • extracts shared properties of "FederatedSearchQuery" and "SearchQuery" into a SearchQueryBase
  • add custom JsonConverter to handle federated search in request (empty object needs to be included, cause that causes federated search to work)
  • added tests

PR checklist

Please check if your PR fulfills the following requirements:

  • [ x ] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
  • [ x ] Have you read the contributing guidelines?
  • [ x ] Have you made sure that the title is accurate and descriptive of the changes?

Thank you so much for contributing to Meilisearch!

@curquiza
Copy link
Member

Hello @apt-TebbeM

thank you for your PR! Let me know when the PR is ready 😊

@curquiza curquiza added the enhancement New feature or request label Oct 16, 2024
@apt-TebbeM apt-TebbeM marked this pull request as ready for review October 17, 2024 05:48
@apt-TebbeM
Copy link
Contributor Author

apt-TebbeM commented Oct 17, 2024

I think it could be reviewed. I actually thought about chaning the API for the federated search part to something like this:

public async Task<ISearchable<T>> FederatedMultiSearchAsync<T>(List<FederatedSearchQuery> queries,
            MultiSearchFederationOptions federationOptions = default(MultiSearchFederationOptions),
            CancellationToken cancellationToken = default)

to make it less likely to have an empty list of queries.

@apt-TebbeM
Copy link
Contributor Author

Hello @apt-TebbeM

thank you for your PR! Let me know when the PR is ready 😊

you can go ahead

@curquiza curquiza self-requested a review November 6, 2024 14:03
@apt-TebbeM
Copy link
Contributor Author

@curquiza when will this pr be reviewed? :)

@curquiza
Copy link
Member

Hello @apt-TebbeM I'm sorry but I have a loooot on my plate right now. I will maybe be able to review your PR next week. I'll do my best. But busy work period at the moment

But be sure I don't forget you!

@curquiza
Copy link
Member

curquiza commented Jan 8, 2025

@apt-TebbeM if you are still here, can you answer @ahmednfwela point above 👆 so that we can improve or merge the PR?

@apt-TebbeM
Copy link
Contributor Author

@curquiza @ahmednfwela I've updated the PR as suggested

@curquiza curquiza requested a review from ahmednfwela January 21, 2025 13:52
@apt-TebbeM
Copy link
Contributor Author

Is there still a desire for this to be merged? @ahmednfwela

/// <summary>
/// Always include property in json. MultiSearchFederationOptions will be serialized as "{}"
/// </summary>
public class MultiSearchFederationOptionsConverter : JsonConverter<MultiSearchFederationOptions>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see what problem does this converter solve

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The API requiers a empty "federation" object when calling the /multisearch endpoint this is to respond in the expected format:

{
  "hits": [ ...],
  "processingTimeMs": 4,
  "limit": 20,
  "offset": 0,
  "estimatedTotalHits": 11
}

When the empty object parameter is not included it responds in a totaly different way:

{
  "results": [
    {
      "indexUid": "searchIndex1",
      "hits": [...],
      "query": "w",
      "processingTimeMs": 4,
      "limit": 20,
      "offset": 0,
      "estimatedTotalHits": 11
    },
    {
      "indexUid": "searchIndex2",
      "hits": [...],
      "query": "w",
      "processingTimeMs": 0,
      "limit": 20,
      "offset": 0,
      "estimatedTotalHits": 0
    },
    {
      "indexUid": "searchIndex3",
      "hits": [...],
      "query": "w",
      "processingTimeMs": 0,
      "limit": 20,
      "offset": 0,
      "estimatedTotalHits": 0
    }
  ]
}

@apt-TebbeM
Copy link
Contributor Author

What are the next steps here? @curquiza @ahmednfwela

@apt-TebbeM
Copy link
Contributor Author

Is there still a chance to this into the package?

@brunoocasali brunoocasali self-requested a review May 22, 2025 12:56
Copy link
Member

@curquiza curquiza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you and sorry for the delay

bors merge

@curquiza curquiza changed the title Add federated multisearch to MeilisearchClient Add support of federated multisearch Aug 8, 2025
@meili-bors
Copy link
Contributor

meili-bors bot commented Aug 8, 2025

Build succeeded:

@meili-bors meili-bors bot merged commit a606ba0 into meilisearch:main Aug 8, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[v1.10.0] Federated search

3 participants